<!doctype html>
<html><head>
	<meta charset="utf-8">
	<title>任务中心</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	
	<!-- jQuery-->
	<script type="text/javascript" src="/static/plugins/jquery/jquery-3.6.0.min.js"></script>
	
	<!-- layui-->
	<link rel="stylesheet" href="/static/plugins/layui/2.7.6/css/layui.css" media="all">
	<script src="/static/plugins/layui/2.7.6/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
</head>
<body style="padding: 10px 0 0 10px;">
	<div class="layui-tab layui-tab-brief" style="background-color: #fff;">
		<ul class="layui-tab-title">
			<li data-loaded="0" onclick="doReload(this, 'id_iframe_4')">制单中<span class="layui-badge" id="id_tack_num_init"></span></li>
			<li class="layui-this" data-loaded="1">待处理<span class="layui-badge" id="id_tack_num_process"></span></li>
			<li data-loaded="0" onclick="doReload(this, 'id_iframe_2')">已处理</li>
			<li data-loaded="0" onclick="doReload(this, 'id_iframe_3')">已完成</li>
		</ul>
		<div class="layui-tab-content" style="padding: 0;">
			<div class="layui-tab-item">
				<iframe id="id_iframe_4" frameborder="0" scrolling="yes" style="width:100%; height:100%;" src="/indexCommonOfMenu?menuId=10225"></iframe>
			</div>
			<div class="layui-tab-item layui-show">
				<iframe id="id_iframe_1" frameborder="0" scrolling="yes" style="width:100%; height:100%;" src="/indexCommonOfMenu?menuId=10173"></iframe>
			</div>
			<div class="layui-tab-item">
				<iframe id="id_iframe_2" frameborder="0" scrolling="yes" style="width:100%; height:100%;" src="/indexCommonOfMenu?menuId=10174"></iframe>
			</div>
			<div class="layui-tab-item">
				<iframe id="id_iframe_3" frameborder="0" scrolling="yes" style="width:100%; height:100%;" src="/indexCommonOfMenu?menuId=10175"></iframe>
			</div>
		</div>
	</div>
	
	<script type="text/javascript">
	$(function() {
		var height = window.innerHeight - 50;
		$('#id_iframe_4').css('height', height + 'px');
		$('#id_iframe_1').css('height', height + 'px');
		$('#id_iframe_2').css('height', height + 'px');
		$('#id_iframe_3').css('height', height + 'px');
		loadIndex();
	});
	function doReload(dom, id_iframe) {

		
		var loaded = $(dom).attr('data-loaded');
		if(loaded == 0) {
			$(dom).attr('data-loaded', 1);
			document.getElementById(id_iframe).contentWindow.location.reload(true);
		}
		
		loadIndex();
	}
	
	function loadIndex() {
		$.ajax({
			async: false, // 同步获取
			type: "POST",
			url: '/api/inter/task/index',
			data: {},
			success: function (res) {
				if (res.code == 0) {
					var numInit = res.data.numInit;
					var numProcess = res.data.numProcess;
					$('#id_tack_num_init').html(res.data.numInit);
					$('#id_tack_num_process').html(res.data.numProcess);
					if(numInit == 0) {
						$('#id_tack_num_init').hide();
					} else {
						$('#id_tack_num_init').show();
					}
					if(numProcess == 0) {
						$('#id_tack_num_process').hide();
					} else {
						$('#id_tack_num_process').show();
					}
				} else {
					alert(data.msg);
				}
			}
		});
	}
	
	
	</script>
</body>
		
</html>